
var span = document.querySelector('#userNname')
var ues_name = document.querySelector('.ues_name input')
var reg = /^[\u4e00-\u9fa5]{4,10}$/
var app = document.querySelector('.nihao span')
var yzm = document.querySelector('.yzm1')
function fn() {
  $.ajax({
    type: "post",
    url: "http://47.94.4.201/index.php/index/index/login",
    data: {
      name: $('#userNname').val(),
      pwd: $('#password').val(),
      vercode: $('#yzm').val()
    },
    dataType: 'json',
    success: (a) => {
      console.log(a);
      if (a.msg) {
        alert(`${a.msg}`)
        if (a.msg == '登录信息') {
          location.assign('../首页/首页.html')
        }
      }
    },
    error: (e) => {
      console.log(e);
    }
  })
}
//
yzm.addEventListener('click', () => {
  $.ajax({
    type: "get",
    url: "http://47.94.4.201/index.php/index/index/getcode",
    dataType: 'json',
    success: (a) => {
      app.innerHTML = `${a.msg}`
      console.log(a);
    },
    error: (e) => {
      console.log(e);
    }
  })
})